/*--------------------------------------------------------------------------
 DEPUI-GFX-TK 3.0 - GPL portable source code libraries 
 http://www.deleveld.dds.nl/depui.htm
 See file docs/copying for copyright details
 ---------------------------------------------------------------------------*/

/* A DOS utility program to simplify making a new version */

#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <time.h>
#include <unistd.h>

int main(void)
{
	time_t now;
	FILE *history = fopen("docs/history.txt", "a");
	FILE *version = fopen("version.txt", "r");

	assert(history);

	time(&now);
	fprintf(history, "- %s", asctime(localtime(&now)));

	if (version) {
		while (!feof(version))
			fputc(fgetc(version), history);
		fputc('\n', history);
		fputc('\n', history);
		fclose(version);
	}
	unlink("version.txt");
  done:
	fclose(history);
	return 0;
}
